package com.jd.ymcc.controller;

import com.jd.ymcc.SearchDoc;
import com.jd.ymcc.result.JSONResult;
import com.jd.ymcc.service.ISearchService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/courseEs")
public class SearchController {
    @Autowired
    private ISearchService searchService;
    /**
     * 将doc数据保存到es接口
     * @param courseDoc
     * @return
     */
    @PostMapping("/saveCourseEs")
    public JSONResult saveCourseEs(@RequestBody SearchDoc courseDoc){
        searchService.save(courseDoc);
        return JSONResult.success();
    }
}
